//
//  GQHomeFamousRecommend.m
//  GuQu
//
//  Created by HELIUM STAR on 15/5/11.
//  Copyright (c) 2015年 HELIUM STAR. All rights reserved.
//

#import "GQHomeFamousRecommend.h"
#import "GQFameHallController.h"
#import "GQHomeFamousCell.h"


@interface GQHomeFamousRecommend () <UITableViewDataSource, UITableViewDelegate>

@end

@implementation GQHomeFamousRecommend

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageWithOriginalName:@"distribute_back"] style:UIBarButtonItemStyleDone target:self action:@selector(backToPre)];
    self.navigationItem.title = @"名人推荐";
    
    //创建UISearchBar
    
    UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, kNavigatationBarHeight, kScreenWidth, 40)];
    searchBar.placeholder = @"搜索名人";
    [self.view addSubview:searchBar];
    
    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(searchBar.frame), kScreenWidth, kScreenHeight- kNavigatationBarHeight - searchBar.height) style:UITableViewStylePlain];
    tableView.delegate = self;
    tableView.dataSource = self;
    tableView.showsVerticalScrollIndicator = NO;
    [self.view addSubview:tableView];
}

- (void)backToPre
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    static NSString *flag = @"flag";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:flag];
    if (cell == nil) {
        cell = [[GQHomeFamousCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:flag];
    }
    return cell;
    
}



- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{

    return 60;
}

@end
